﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cesave.Domain.PermisosModule.Entities;
using Cesave.Domain.Core.Specification;

namespace Cesave.Domain.PermisosModule.Contracts.Ciclos
{
	/// <summary>
	/// 
	/// </summary>
	public class CicloActualSpecification
		: Specification<Ciclo>
	{
		#region Private properties

		/// <summary>
		/// 
		/// </summary>
		private bool _actual = default(bool);

		#endregion

		#region Constructor

		/// <summary>
		/// 
		/// </summary>
		public CicloActualSpecification()
		{
			_actual = true;
		}

		#endregion

		#region Specification overrides

		/// <summary>
		/// 
		/// </summary>
		/// <returns></returns>
		public override System.Linq.Expressions.Expression<Func<Ciclo, bool>> SatisfiedBy()
		{
			Specification<Ciclo> specification = new TrueSpecification<Ciclo>();
			specification &= new DirectSpecification<Ciclo>(ciclo => ciclo.Actual == _actual);
			return specification.SatisfiedBy();
		}

		#endregion

	}
}
